<?php
namespace app\course\event\listeners\course;

use think\facade\Event;
use app\common\event\subscribes\notify\Notify;

/**
 * 课程购买通知
 */
class CourseSell
{
    public static function handle($param)
    {
        $data = [
            'user' => $param['teacher_user_id'],
            'type' => 'system_notify',
            'key'  => 'course_sell',
            'var'  => [
                'course_title' => $param['course_title'],
                'teacher_name' => $param['teacher_name']
            ],
        ];
        
        Event::subscribe(Notify::class);
        Event::trigger('Notify', $data);
    }
}
